package com.login.domain.details;

import com.login.domain.po.AdminUser;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

/**
 * @author 路亚
 * @version 0.1
 * @className AdminUserDetails
 * @description
 * @date 2024/12/12 16:29
 * @since jdk11
 */
@Data
@NoArgsConstructor
public class AdminUserDetails implements UserDetails {

    private AdminUser adminUser;



    public AdminUserDetails(AdminUser adminUser) {
        this.adminUser = adminUser;
    }
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return adminUser.getPassword();
    }

    @Override
    public String getUsername() {
        return adminUser.getUsername();
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
